package lxzh;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@SpringBootApplication
@EnableEurekaClient //Eureka Client
@RestController
public class CommonApplication {
    public static void main(String[] args) {
         
        new SpringApplicationBuilder(CommonApplication.class).web(WebApplicationType.SERVLET).run(args);
    }
    
    
    @Value("${server.port}")
    String port;
    
    @Value("${spring.application.name}")
    String applicationName;
    
    @RequestMapping("/info")
    public String home(@RequestParam String name) {
		return "hello"+ applicationName+ " "+ port;
	}
}